export default {
    data() {
        return {
            targetUrl: '/roles',
            template: {
                code: {
                    title: '代码',
                    value: ''
                },
                name: {
                    title: '名称',
                    value: ''
                },
                state: {
                    title: '状态',
                    value: 'Y',
                    component: {
                        name: "el-switch",
                        activeColor: "#13ce66",
                        inactiveColor: "#ff4949",
                        activeValue: "Y",
                        inactiveValue: "N",
                        activeText: '启用',
                        inactiveText: '禁用',
                    }
                }
            },
            columns: [{
                    title: 'ID',
                    key: 'id',
                },
                {
                    title: '代码',
                    key: 'code',
                },
                {
                    title: '名称',
                    key: 'name'
                },
                {
                    title: '状态',
                    key: 'state',
                    component: {
                        name: "el-switch",
                        activeColor: "#13ce66",
                        inactiveColor: "#ff4949",
                        activeValue: "Y",
                        inactiveValue: "N",
                        disabled: true
                    }
                }
            ],
            rules: {
                code: [{
                    required: true,
                    message: '请输入代码',
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    message: '请输入名称',
                    trigger: 'blur'
                }],
            }
        }
    }
}
